package com.runoob;

import com.runoob.decorator.RedShapeDecorator;
import com.runoob.decorator.ShapeDecorator;
import com.runoob.shape.Circle;
import com.runoob.shape.Rectangle;
import com.runoob.shape.Shape;

/**
 * title
 * <p>
 *
 * </p>
 *
 * @author zenglei
 * @date 2023/07/18/ 11:49
 */
public class DecoratorPatternDemo {

    public static void main(String[] args) {
        Shape circle = new Circle();
        ShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());
        //Shape redCircle = new RedShapeDecorator(new Circle());
        //Shape redRectangle = new RedShapeDecorator(new Rectangle());
        System.out.println("正常边框圆");
        circle.draw();

        System.out.println("\n红色边框圆");
        redCircle.draw();

        System.out.println("\n红色边框矩形");
        redRectangle.draw();
    }

}
